import { computed } from "vue";
export default function () {
  const statusBarHeight = computed(() => {
    // #ifdef APP-PLUS || H5
    return uni.getSystemInfoSync().statusBarHeight;
    // #endif
  });
  const menuButtonInfo = computed(() => {
    // #ifndef APP-PLUS || H5
    let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
    return menuButtonInfo;
    // #endif
  });
  const holderStyle = computed(() => {
    let obj = {};
    // #ifdef APP-PLUS || H5
    obj = {
      height: `calc(${statusBarHeight}px + 88rpx)`,
    };
    // #endif
    // #ifndef APP-PLUS || H5
    obj = {
      height: `calc(${menuButtonInfo.value.top}px + ${menuButtonInfo.value.height}px)`,
    };
    // #endif
    return obj;
  });
  const windowHeight = computed(() => {
    return { minHeight: uni.getWindowInfo().windowHeight + "px" };
  });

  return {
    statusBarHeight,
    menuButtonInfo,
    holderStyle,
    windowHeight,
  };
}
